package cn.yunhe.services;

import cn.yunhe.dao.IFoodDaoMapper;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
/**
 * 周依博
 */
public class CountFoodService {
    SqlSession session = null;
    IFoodDaoMapper foodDaoMapper =null;
    public int countFood(int mid){
        int result;
        try{
            session = SqlSessionFactoryUtil.getSqlSession();
            foodDaoMapper =session.getMapper(IFoodDaoMapper.class);
            result=foodDaoMapper.countFood(mid);
        }finally {
            session.close();
        }
        return result;

    }
}
